package rjeutsky.models;

public class CardType {
	private TypeEnum type;
	
	private boolean isSent;
	
	public void setType(TypeEnum type) {
		this.type = type;
	}
	
	public TypeEnum getType() {
		return type;
	}
	
	public void setIsSent(boolean isSent) {
		this.isSent = isSent;
	}
	
	public boolean getIsSent() {
		return isSent;
	}
	
	@Override
	public String toString() {
		return String.format("CardType [isSent=%1$b, type=%2$s]", isSent, type);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CardType other = (CardType) obj;
		if (isSent != other.isSent)
			return false;
		if (type == null) {
			if (other.type != null)
				return false;
		} else if (!type.equals(other.type))
			return false;
		return true;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (isSent ? 1231 : 1237);
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		return result;
	}
}
